﻿<?xml version="1.0" encoding="UTF-8"?>
<!--This HandlerConfiguration is a comprehensive sample showing how the handler can be configured for various
operations. This is a typical 'clean' configuration where even the Error flags are set because we intend the 
system to throw the specified error (which helps test if the consumer is really capable of handling exceptions).
It is possible for the system to be misconfigured.For example, a response could have a ResponseBehaviour set to
Error but the errorType could have been accidentally set to None. However, such an issue will be detected by the 
HandlerConfiguration class when the Validate() method is called, so, it is not possible to encounter such errors
during the latter stages (say, during response construction)-->
<HandlerConfiguration xmlns="urn:mockingbird.engine.business.configuration:handlerconfiguration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mockingbird.engine.business.configuration:handlerconfiguration ..\source\MockingBird\MockingBird.Engine.Business\Configuration\HandlerConfiguration.xsd">
	<Wsdl>String</Wsdl>
	<ControlSettings>
		<OperationNameInferenceStrategy>SoapAction</OperationNameInferenceStrategy>
	</ControlSettings>
	<Operations>
    <!--The OneWay method. The 'GetCustomer' name doesnt signify anything. Its only a test-->
		<Operation Name="GetCustomer" ResponseStrategy="None">
		</Operation>
    <!--An operation that requires the system to pick up a defaultresponse which in turn uses 
    standard behavior (ie) no errors. We could have additional operations here which had default 
    responses that exhibited error behavior, but those conditions can be tested in the XPathResponses
    operation below-->
		<Operation Name="StandardMessage" ResponseStrategy="Default">
			<DefaultResponse ResponseBehaviour="Standard" FileName="DefaultStandardResponse.xml" ErrorType="None"/>
		</Operation>
		<!--This operation requires the system to pick up a response from within the collection of 
    XPathResponses. To do this, the system must evaluate the XPath expression against the request message
    and if the result there matches the result in the RESULT element here, then the response element is 
    picked up and further processing is done (based on the behavior required for that response-->
    <Operation Name="CandidateForXPath" ResponseStrategy="XPath">
			<XPathBasedResponses>
				<XPathBasedResponse>
          <Expression>/*[local-name()='Body']/*[local-name()='Customer']/*[local-name()='Name']</Expression>>
					<Result>XPathStandard</Result>>
					<Response ResponseBehaviour="Standard" FileName="XPathStandardResponse.xml" ErrorType="None"/>
				</XPathBasedResponse>
				<XPathBasedResponse>
          <Expression>/*[local-name()='Body']/*[local-name()='Customer']/*[local-name()='Name']</Expression>>
          <Result>XPathErrorSoapFault</Result>>
          <Response ResponseBehaviour="Error" FileName="XPathErrorResponseSoapFault.xml" ErrorType="SoapFault"/>
				</XPathBasedResponse>
				<XPathBasedResponse>
          <Expression>/*[local-name()='Body']/*[local-name()='Customer']/*[local-name()='Name']</Expression>>
          <Result>XPathErrorTimeout</Result>>
          <Response ResponseBehaviour="Error" FileName="" ErrorType="Timeout"/>
				</XPathBasedResponse>
				<XPathBasedResponse>
					<Expression/>
					<Result/>
					<Response ResponseBehaviour="Variable" FileName="XPathVariableGoodResponse.xml" ErrorType="SoapFault"/>
				</XPathBasedResponse>
			</XPathBasedResponses>
		</Operation>
	</Operations>
</HandlerConfiguration>

